<?php

namespace app\api\service\weixinApp;

use app\lib\exception\ParameterException;

use think\Db;
use think\Exception;

class MemberlevelPay extends BasePay
{
    public function pay($param)
    {
//        try {
            $openid = '';

            // 调用微信支付
            $trade_no = $param->order_no;
            $total_fee = $param->vip_cost;
            $body = '开通会员等级';
            $pay_back_url = config('wx.memberlevel_pay_back_url');
            $result = $this->run($total_fee, $body, $openid, $trade_no, $pay_back_url);

            //return $result;
            //return true;
            return show(config('status.SUCCESS_STATUS'), 'ok', $result);
//        } catch (Exception $e) {
//            throw new ParameterException([
//                'msg' => $e->getMessage()
//            ]);
//        }
    }
}